<template>
    <div v-if="isShow" class="code" @click="hide">
        <div class="code-box" @click.stop>
            <img :src="codeUrl" alt="">
            <!-- <img :src="codeUrl" alt=""> -->
        </div>
    </div>
</template>

<script>
export default {
    props:['codeUrl'],
    data(){
        return{
            isShow : false,
        }
    },
    methods:{
        show(){
            this.isShow = true;
        },
        hide(){
            this.isShow = false;
        },
    }
}
</script>


<style scoped>
.code{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,.5);
    z-index: 3;
}
.code .code-box{
    width: 250px;
    height: 250px;
    background-color: #fff;
    border-radius: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    padding: 18px;
    overflow: hidden;
}
.code .code-box img{
    width: 100%;
    height: 100%;
}
</style>